package com.lebang.service;

import java.time.LocalDateTime;

import com.lebang.domain.NewsDetail;
import com.lebang.example.NewsDetailExample;
import com.lebang.model.NewsModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 签到策略配置
 *
 * @Author hwq
 * @Date 2020-03-11
 */
@Service
public class NewsDetailService extends BaseService<NewsDetail, Long, NewsDetailExample> {
    public void insert(NewsModel record) {
        NewsDetail newsDetail = new NewsDetail();
        newsDetail.setCreateTime(LocalDateTime.now());
        newsDetail.setModifyTime(LocalDateTime.now());
        newsDetail.setHasDeleted(0);
        newsDetail.setItemId(record.getItem_id());
        newsDetail.setImageUrl(record.getImage_url());
        newsDetail.setTitle(record.getTitle());
        newsDetail.setSource(record.getSource());
        newsDetail.setStarTime("");
        newsDetail.setContent(record.getContent());
        this.insertModel(newsDetail);
    }
}
